﻿<%@ Import Namespace="AFI.Speargun.Web.Paging" %>
<%@ Import Namespace="AFI.Speargun.Web.Core" %>

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IPagedList<AFI.Speargun.Web.Models.InventoryChecking>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    盘点单 - 列表
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        列表</h2>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="data-table">
        <tr>
            <th>
                <%= Html.ActionLink("[新建]", "Create") %>
            </th>
            <th>
                单号
            </th>
            <th>
                创建者
            </th>
            <th>
                创建日期
            </th>
            <th>
                部门
            </th>
            <th>
                状态
            </th>
        </tr>
        <% foreach (var item in Model)
           {
               if (!item.DepartmentReference.IsLoaded)
                   item.DepartmentReference.Load();
        %>
        <tr>
            <td>
                <%= Html.ActionLink("[编辑]", "Edit", new { id=item.InventoryCheckingId }) %>
            </td>
            <td>
                <%= Html.ActionLink(item.InventoryCheckingId.ToString(), "Details", new { id=item.InventoryCheckingId })%>
            </td>
            <td>
                <%= Html.Encode(Membership.GetUser(item.CreateBy, false)) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:d}", item.CreateDate)) %>
            </td>
            <td>
                <%= Html.Encode(item.Department.Appellation) %>
            </td>
            <td>
                <%= Html.Encode(((InventoryCheckingStatus)item.Status).GetTextValue())%>
            </td>
        </tr>
        <% } %>
    </table>
    <div class="pager">
        <%= Html.Pager(Model.PageSize, Model.PageNumber, Model.TotalItemCount) %>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="LeftContent" runat="server">
</asp:Content>
